#!/usr/bin/env bash
### every exit != 0 fails the script
set -e

echo "Install some common tools for further installation"
apt install -y vim curl ca-certificates  wget git net-tools iputils-ping telnet tcpdump zip unzip locales bzip2 \
	file-roller fcitx-googlepinyin shutter gwenview filezilla python3-pip python3-dev build-essential \
	language-pack-zh-hant language-pack-gnome-zh-hant \
        python-numpy #used for websockify/novnc
apt-get clean -y

cat > /etc/xdg/autostart/fcitx-autostart.desktop <<EOF
[Desktop Entry]
_Name=Fcitx
_GenericName=Input Method
_Comment=Start Input Method
Exec=fcitx-autostart
Icon=fcitx
Terminal=false
Type=Application
Categories=System;Utility;
StartupNotify=false
NoDisplay=true
X-GNOME-Autostart-Phase=Applications
X-GNOME-AutoRestart=false
X-GNOME-Autostart-Notify=false
X-KDE-autostart-after=panel
X-KDE-StartupNotify=false
EOF

echo "generate locales for en_US.UTF-8 zh_CN.UTF-8"
locale-gen zh_CN.UTF-8
